import service from '@/utils/crmRequest'

export default () => ({
  // 产品列表
  PRODUCT_LIST: (data) => {
    return service({
      url: '/api/product/getList',
      method: 'post',
      data
    })
  },
  // 产品创建
  PRODUCT_CREATE: (data) => {
    return service({
      url: '/api/product/create',
      method: 'post',
      data
    })
  },
  // 产品详情
  PRODUCT_DETAIL: (params) => {
    return service({
      url: '/api/product/getDetail',
      method: 'get',
      params
    })
  },
  // 删除产品
  PRODUCT_DELETE: (params) => {
    return service({
      url: '/api/product/deleteById',
      method: 'delete',
      params
    })
  },
  // 编辑产品
  PRODUCT_EDIT: (data) => {
    return service({
      url: '/api/product/edit',
      method: 'PUT',
      data
    })
  },
  // 变更产品
  PRODUCT_CHANGE: (data) => {
    return service({
      url: '/api/product/change/create',
      method: 'post',
      data
    })
  },
  // 下架产品
  DOWN_PRODUCT: (data) => {
    return service({
      url: '/api/product/downProduct',
      method: 'put',
      data
    })
  },
  // 产品终端价列表
  PRODUCT_PRICE_LIST: (data) => {
    return service({
      url: '/api/productPriceStrategy/list',
      method: 'post',
      data
    })
  },
  // 产品终端价详情
  PRODUCT_PRICE_DETAIL: (id) => {
    return service({
      url: '/api/productPriceStrategy/detail?id=' + id,
      method: 'get',
    })
  },
  // 创建产品终端价
  CREATE_PRODUCT_PRICE: (data) => {
    return service({
      url: '/api/productPriceStrategy/create',
      method: 'post',
      data
    })
  },
  // 编辑产品终端价
  EDIT_PRODUCT_PRICE: (data) => {
    return service({
      url: '/api/productPriceStrategy/update',
      method: 'put',
      data
    })
  },
  // 变更产品终端价
  CHANGE_PRODUCT_PRICE: (data) => {
    return service({
      url: 'api/productPriceStrategy/change',
      method: 'put',
      data
    })
  },
  // 作废产品终端价
  OBSOLETE_PRODUCT_PRICE: (data) => {
    return service({
      url: '/api/productPriceStrategy/apply_ban',
      method: 'put',
      data
    })
  },
  // 删除产品终端价
  DELETE_PRODUCT_PRICE: (data) => {
    return service({
      url: '/api/productPriceStrategy/deleteById',
      method: 'delete',
      data
    })
  },
  // 删除产品终端价
  PRODUCT_ALIAS_CHECK: (params) => {
    return service({
      url: '/api/product/checkAlias',
      method: 'get',
      params
    })
  },
  // 变更产品终端价--正常交易的产品终端价列表
  TRADING_PRODUCT_PRICE_LIST: (params) => {
    return service({
      url: '/api/relationStandard/getList-by-product-price',
      method: 'get',
      params
    })
  },
  // 进货关系及列表
  PURCHASE_PRICE_LIST: (data) => {
    return service({
      url: '/api/relationStandard/getList-from-product',
      method: 'post',
      data
    })
  },
  // 进货渠道关系价格----》添加终端
  PURCHASE_PRICE_ADD_TERMINAL: (data) => {
    return service({
      url: '/api/relationStandard/getList-by-product-price',
      method: 'post',
      data
    })
  },
  // 进货渠道关系价格----》变更终端价
  PURCHASE_PRICE_CHANGE: (data) => {
    return service({
      url: '/api/relationStandard/set-new-terminal-price',
      method: 'post',
      data
    })
  }

})
